#include "time_thread.h"
#include <QDate>

MyThread::MyThread():QThread()
{
    running = true;
}
//线程入口函数
void MyThread::run()
{
    while(running == true)
    {
        sleep(1);
        QDateTime curDateTime=QDateTime::currentDateTime();
        QString str = curDateTime.toString("yyyy-MM-dd hh:mm:ss");

        qDebug()<<"thread run";
        emit timeupdata(str);
    }

}

